Package org.openquark.cal_Cal_Utilities_DirectedGraph

Source Code of org.openquark.cal_Cal_Utilities_DirectedGraph._lambda__fold_Reachable_In_Depth_First_Search_Order__1

package org.openquark.cal_Cal_Utilities_DirectedGraph;

import org.openquark.cal.internal.runtime.lecc.RTExecutionContext;
import org.openquark.cal.internal.runtime.lecc.RTFullApp;
import org.openquark.cal.internal.runtime.lecc.RTResultFunction;
import org.openquark.cal.internal.runtime.lecc.RTSupercombinator;
import org.openquark.cal.internal.runtime.lecc.RTValue;
import org.openquark.cal.runtime.CALExecutorException;

public final class _lambda__fold_Reachable_In_Depth_First_Search_Order__1 extends RTSupercombinator {
  /**
   * Singleton instance of this class.
   */
  public static final _lambda__fold_Reachable_In_Depth_First_Search_Order__1 $instance =
    new _lambda__fold_Reachable_In_Depth_First_Search_Order__1();

  private _lambda__fold_Reachable_In_Depth_First_Search_Order__1() {
  }

  public final int getArity() {
    return 4;
  }

  public final java.lang.String getModuleName() {
    return "Cal.Utilities.DirectedGraph";
  }

  public final java.lang.String getUnqualifiedName() {
    return "$lambda$foldReachableInDepthFirstSearchOrder$1";
  }

  public final java.lang.String getQualifiedName() {
    return
      "Cal.Utilities.DirectedGraph.$lambda$foldReachableInDepthFirstSearchOrder$1";
  }

  /**
   * f
   * This method implements the function logic of the CAL function Cal.Utilities.DirectedGraph.$lambda$foldReachableInDepthFirstSearchOrder$1
   */
  public final RTValue f(final RTResultFunction $rootNode, final RTExecutionContext $ec) throws CALExecutorException {
    // Arguments
    RTValue vertexNum = $rootNode.getArgValue();
    RTValue $currentRootNode;
    RTValue accum = ($currentRootNode = $rootNode.prevArg()).getArgValue();
    RTValue graph =
      ($currentRootNode = $currentRootNode.prevArg()).getArgValue();
    RTValue startVertexFn = $currentRootNode.prevArg().getArgValue();

    // Release the fields in the root node to open them to garbage collection
    $rootNode.clearMembers();
    return
      f4S(
        RTValue.lastRef(startVertexFn, startVertexFn = null),
        RTValue.lastRef(graph, graph = null),
        RTValue.lastRef(accum, accum = null),
        RTValue.lastRef(vertexNum, vertexNum = null),
        $ec);
  }

  /**
   * f4L
   * This method implements the function logic of the CAL function Cal.Utilities.DirectedGraph.$lambda$foldReachableInDepthFirstSearchOrder$1
   */
  public final RTValue f4L(RTValue startVertexFn, RTValue graph, RTValue accum, RTValue vertexNum, RTExecutionContext $ec) throws CALExecutorException {
    return
      f4S(
        RTValue.lastRef(startVertexFn, startVertexFn = null),
        RTValue.lastRef(graph, graph = null),
        RTValue.lastRef(accum, accum = null),
        RTValue.lastRef(vertexNum, vertexNum = null),
        $ec);
  }

  /**
   * f4S
   * This method implements the function logic of the CAL function Cal.Utilities.DirectedGraph.$lambda$foldReachableInDepthFirstSearchOrder$1
   */
  public final RTValue f4S(RTValue startVertexFn, RTValue graph, RTValue accum, RTValue vertexNum, RTExecutionContext $ec) throws CALExecutorException {
    // Top level supercombinator logic
    return
      startVertexFn.apply(
        accum,
        new RTFullApp.General._2._S(
          Get_Vertex.$instance,
          graph,
          vertexNum));
  }

}
TOP

Related Classes of org.openquark.cal_Cal_Utilities_DirectedGraph._lambda__fold_Reachable_In_Depth_First_Search_Order__1

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.